import type { ProductForm } from './model';

import type { ID, IDS } from '#/api/common';

// import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
 * 物模型服务列表
 * @param id
 */
export function thingModelSeverList(id: string) {
  return requestClient.get(`/iot/thingModel/block/select?productId=${id}`);
}
/**
 * 新增物模型服务列表
 * @param data
 */
export function saveThingModel(data: Partial<ProductForm>) {
  return requestClient.postWithMsg(`/iot/thingModel/block/add`, data);
}
/**
 * 修改物模型服务列表
 * @param data
 */
export function updateThingModel(data: Partial<ProductForm>) {
  return requestClient.postWithMsg(`/iot/thingModel/block/update`, data);
}

/**
 * 服务详情
 * @param id
 */
export function getThingModelDetail(id: ID | IDS) {
  return requestClient.get(`/iot/thingModel/block/detail?id=${id}`);
}

/**
 * 删除服务
 * @param id
 * @returns
 */

export function removeThingModel(id: ID | IDS) {
  return requestClient.post(`/iot/thingModel/block/remove?id=${id}`);
}

/**
 * tsl 导出
 */

export function tslExport(productId: string) {
  return requestClient.get(`/iot/product/tslExport?productId=${productId}`);
}
